package cj.hrm.entity;

import java.text.SimpleDateFormat;
import java.util.Date;

public class User {
    private static final long serialVersionUID = 1L;
    private Integer id;//id
    private String username;//用户名
    private String loginname;//登录名
    private String password;//密码
    private Status status;//用户状态
    private String email;//右键
    private Integer emp_id;  //关联员工信息，目的是为了得到员工id
    private Integer che_id;  //关联员工考勤信息，目的是为了得到员工id
    //关于时间的格式转换
    private Date createdate;//创建时间
    private String creatTimeStr;
    private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    //无参构造器
    public User() {
        super();
    }
    //setter和getter方法

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getLoginname() {
        return loginname;
    }

    public void setLoginname(String loginname) {
        this.loginname = loginname;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Status getStatus() {
        return status;
    }

    public void setStatus(Status status) {
        this.status = status;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public Integer getEmp_id() {
        return emp_id;
    }

    public void setEmp_id(Integer emp_id) {
        this.emp_id = emp_id;
    }

    public Integer getChe_id() {
        return che_id;
    }

    public void setChe_id(Integer che_id) {
        this.che_id = che_id;
    }

    public Date getCreatedate() {
        return createdate;
    }

    public void setCreatedate(Date createdate) {
        this.createdate = createdate;
        String time = sdf.format(createdate);
        setCreatTimeStr(time);
    }

    public String getCreatTimeStr() {
        return creatTimeStr;
    }

    public void setCreatTimeStr(String creatTimeStr) {
        this.creatTimeStr = creatTimeStr;
    }
    @Override
    public String toString() {
        return "User [status=" + status + "]";
    }
}

